package com.diligreat.service; 

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.diligreat.domain.Content;
import com.diligreat.mapper.ContentMapper;

/**  
 * @Author Bruce 
 * @Date 2012-10-21
 * @Comments
 */
@Service
public class ContentService {

	@Autowired
	private ContentMapper contentMapper;

	public void addContent(Content content) {
		contentMapper.insertContent(content);
		
	}

	public void addCover(Content content) {
		contentMapper.insertCover(content);
		
	}

	public List<Content> getAllContent() {
		return contentMapper.getAllContent();
	}

	public Content retriveContent(long id) {
		return contentMapper.getContentById(id);
	}

	public Integer updateContent(Content content) {
		return contentMapper.updateContent(content);
	}

	public Integer deleteContent(long id) {
		return contentMapper.delContent(id);
	}
	

}
 